﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Forms.Design
{
    /// <summary>
    /// 在设计模式下,对字段的描述
    /// </summary>
    public class ColumnDescription
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 是否主键
        /// </summary>
        public bool IsPrimaryKey { get; set; }

        /// <summary>
        /// 是否必填
        /// </summary>
        public bool IsRequired { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string Caption { get; set; }

        /// <summary>
        /// 数据类型
        /// </summary>
        public Type DataType { get; set; }

        /// <summary>
        /// 是否属于标识列
        /// </summary>
        public bool IsIdentity { get; set; }

        /// <summary>
        /// 最大长度(只有当DataType类型为string时有效)。
        /// </summary>
        public int MaxLength { get; set; }
    }
}
